/* 
 * File:   MetaInfo.h
 * Author: Guilherme Monteiro
 *
 */

#ifndef METAINFO_H
#define	METAINFO_H
#include <string>
#include <iostream>
#include <cstdio>
#include <cv.h>
#include <highgui.h>
#include <algorithm>

#include "../headers/GenericModel.h"
#include "../headers/InvalidModelException.h"
#include "../headers/NullImageException.h"
#include "../headers/PathValidator.h"

#define TABELAS_ALTA string("/tabelasAlta")
#define TABELAS_BAIXA string("/tabelasBaixa")
#define BOOKS string("/books")
#define ALTA_RESOLUCAO string("/alta_resolucao")
#define BAIXA_RESOLUCAO string("/baixa_resolucao")
#define METADADOS string("/metadados")
#define ENTRADA string("/entrada")
#define SAIDA string("/saida")
#define LOG_IMAGES string("/logImages")
#define MODEL_PREVIEW string("/modelPreview")

using namespace std;

/**
 * Class responsible to extract the metadata
 * restrained in path to low resolution image
 * path.
 * 
 * @author Guilherme Monteiro
 * 
 */
class MetaInfo {
public:
    MetaInfo();
    MetaInfo(const MetaInfo& orig);
    virtual ~MetaInfo();
    
    string getHighResolutionImagePath();
    string getLowResolutionImagePath();
    
    string getBookName();
    string getPageName();

protected:
    PathValidator* pathValidator;
    
    string originalPath; // path received from input
    
    string highResolutionImagePath;
    string lowResolutionImagePath;
    
    string pageName;
    string bookName;
    
    virtual void setOriginalPath(string originalPath) throw (NullImageException) = 0;
    
    virtual void setMetadata() = 0;
    virtual void setSubMetadata() = 0;
    
    void setLowResolutionImagePath();
    void setHighResolutionImagePath();
    
    void setBookName(string name);
    void setPageName(string name);
    
    string adaptPageName(string pageName);
};

#endif	/* METAINFO_H */

